<?php if (!defined('BASEPATH'))  exit('No direct script access allowed');

define('PROJECTS_PATH', './mes_projets/');
define('RESOURCES_PATH', './uploaded_res/');

function css($file_path){
    if( !is_array($file_path) )
        $file_path = array($file_path);
    
        for( $i=0 ; $i < count( $file_path ) ; $i++)
         echo '<link rel="stylesheet" type="text/css" href="'.base_url( 'assets/'.$file_path[$i] ).'.css" media="screen">'."\n";
}
function js($file_path){
       if( !is_array($file_path) )
        $file_path = array($file_path);
        for( $i=0 ; $i < count( $file_path ) ; $i++)
            echo '<script type="text/javascript" src="'.base_url( 'assets/'.$file_path[$i] ).'.js" ></script>'."\n";
}
/**
 * 
 * @param string     $path_img
 * @param assoc table $params
 * 
 */
function img($path_img , $params = null){
    $img = '<img src="'.base_url( 'assets/'.$path_img ).'" ';
    if( $params != null)
        if(is_array($params))
            foreach ($params as $key=>$value)
                $img .= ' '.$key.'="'.$value.'" ';
        $img .= " >";
        echo $img;
}


function script( $path )
{
    if( !is_array($path))
        $path = array($path);
    $ret ="";
    foreach ($path as $l)
        $ret  .= '<script type="text/javascript" src="'.base_url( 'assets/'.$l ).'.js" ></script>'."\n";
    return $ret;
}